package vn.com.epi.re.data;

public class Pair2<T>  implements Comparable<Pair2<T>> {

    private T first;
    private double second;
    
    public Pair2(T first, double second) {
        setFirst(first);
        setSecond(second);
    }

    public T getFirst() {
        return first;
    }

    public void setFirst(T first) {
        this.first = first;
    }

    public double getSecond() {
        return second;
    }

    public void setSecond(double second) {
        this.second = second;
    }

    @Override
    public int compareTo(Pair2<T> other) {
        if (this.getSecond() == other.second)
            return 0;
        else
            return this.getSecond() > other.second ? -1:1;
    }
}
